package com.training.java.redbox.struts.domain;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CustomerServiceImpl implements CustomerService{
	
	@Autowired
	private CustomerDAO dao;
	
	
	@Override
	public void addCustomer(Customer customer) throws ServiceException {
		try {
			dao.addCustomer(customer);
		} catch (DAOException e) {
			e.printStackTrace();
			throw new ServiceException(e);
		}
		
	}
	
	@Override
	public Customer login(String username, String password)
			throws ServiceException {
		try {
			return dao.login(username, password);
		} catch (DAOException e) {
			e.printStackTrace();
			throw new ServiceException(e);
		}
	}



	@Override
	public List<Customer> getAllCustomers() throws ServiceException {
		return null;
	}

	
	@Override
	public void updateCustomer(Customer customer) throws ServiceException {
		
	}

	@Override
	public void deleteCustomer(String customerId) throws ServiceException {
		
	}

	@Override
	public Customer findCustomerByCustomerId(String customerId)
			throws ServiceException {
		return null;
	}

	
}
